{include file="public/headerbase" /}
{include file="public/left" /}
<div class="right-content">
<ul class="we7-page-tab">
	<li class="active"><a href="./index.php?c=article&a=news&do=list&">图片展示</a></li>
</ul>
<div class="clearfix">
	<form action="" method="get" class="we7-form" role="form">
		<div class="form-group">
			<div class="pull-right">
				<a href="{:url('Banner/addlist')}" class="btn btn-primary">添加图片</a>
			</div>
		</div>
	</form>
	<table class="table we7-table table-hover">
		<col width="150px"/>
		<col width="150px"/>
		<!-- <col width="150px"/> -->
		<col width="150px"/>
		<tr>
			<th>排序</th>
			<th>图片</th>
			<th>操作</th>
		</tr>
		{foreach name="banner" item="val"}
		<tr>
			<th><span>{$val.bid}</span></th>
			<th><span><img src="/uploads/{$val.bimg}" alt="" style="width:100px;"/></span></th>
			<th>
				<span class="link-group">
					<a href="{:url('Banner/update')}?bid={$val.bid}">编辑</a>
					<a href="javascript:;" class="del" onclick="del(this,{$val.bid})">删除</a>
				</span>
			</th>
		</tr>
		{/foreach}
	</table>
	<div class="pull-right">
			</div>
</div>
			</div>
		</div>
	</div>
</div>
</div>
<script type="text/javascript">
	function del(obj,bid){
		if(!confirm('确定删除吗')){
			return false;
		}
		$.ajax({
	        url: "{:url('Banner/del')}",
	        data:{'bid':bid},
	        type: "post",
	        dataType: "json",
	        success: function (mega) {
	          if(mega==1){
	           		util.message('删除图片成功', '', '');
	           		location.reload();
	           }else{
	           		util.message('删除失败', '', '');
	           }
	        }
    	});
	}
</script>
{include file="public/footer" /}